package com.peng.mvvm_wan.fragments

import android.view.View
import androidx.lifecycle.ViewModelProvider
import com.peng.mvvm_wan.R
import com.peng.mvvm_wan.base.BaseFragment
import com.peng.mvvm_wan.databinding.FragmentListBinding
import com.peng.mvvm_wan.viewmodels.ListModel

class ListFragment : BaseFragment<ListModel>() {
    override fun getBindingView(): View? {
        val binding = FragmentListBinding.inflate(layoutInflater)
        binding.lifecycleOwner = this
        binding.listModel = viewModel
        return binding.root
    }

    override fun getResourceId(): Int = R.layout.fragment_list

    override fun initViewModel(): ListModel {
        return ViewModelProvider(requireActivity()).get(ListModel::class.java)
    }
}